package com.project.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.project.bean.ClassBean;
import com.project.dao.IClassDao;
import com.project.service.IClassService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author RJ
 * @date 2022/9/14 22:33
 */
@Service
@Transactional
public class ClassServiceImpl extends ServiceImpl<IClassDao, ClassBean> implements IClassService {
    @Override
    public void addClass(ClassBean classBean) {
        this.baseMapper.addClass(classBean);
    }

    @Override
    public ClassBean getClassInfo(Integer classId) {
        return this.baseMapper.getClassInfo(classId);
    }

    @Override
    public void updClass(Integer classId, String classManager, String classPhone) {
        this.baseMapper.updClass(classId, classManager, classPhone);
    }

    @Override
    public IPage<ClassBean> cutClassByItem(Integer pageNo, Integer pageSize, String className, String areaName) {
        Page<ClassBean> page = new Page<>(pageNo, pageSize);
        IPage<ClassBean> iPage = this.baseMapper.cutClassByItem(page, className, areaName);
        return iPage;
    }
}
